<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class Psa_Group</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name"><img src="../media/images/Class_logo.png"
														alt=" Class"
														title=" Class"
														style="vertical-align: middle"> Psa_Group</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
													<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
						|											<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">User group class.</p>
<p class="description"><p>Here are some examples of using <a href="../psa/Psa_Group.html">Psa_Group</a> object.</p><p><strong>Examples</strong></p><p><strong>1)</strong> Create new user group:  <div class="src-code"><ol><li><div class="src-line">&nbsp;<span class="src-comm">//&nbsp;if&nbsp;you&nbsp;want&nbsp;to&nbsp;create&nbsp;new&nbsp;user&nbsp;group&nbsp;use&nbsp;'new'&nbsp;as&nbsp;argument&nbsp;to&nbsp;constructor</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$group&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../psa/Psa_Group.html">Psa_Group</a></span><span class="src-sym">(</span><span class="src-str">'new'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;<span class="src-comm">//&nbsp;set&nbsp;the&nbsp;name&nbsp;for&nbsp;new&nbsp;group</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$group</span><span class="src-sym">-&gt;</span><span class="src-id"><a href="../psa/Psa_Group.html#var$name">name</a>&nbsp;</span>=&nbsp;<span class="src-str">'my_new_user_group'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;<span class="src-comm">//&nbsp;you&nbsp;can&nbsp;set&nbsp;some&nbsp;custom&nbsp;properties&nbsp;of&nbsp;the&nbsp;new&nbsp;group</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-comm">//&nbsp;and&nbsp;they&nbsp;will&nbsp;be&nbsp;saved&nbsp;with&nbsp;the&nbsp;group</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$group</span><span class="src-sym">-&gt;</span><span class="src-id">is_important_group&nbsp;</span>=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$group</span><span class="src-sym">-&gt;</span><span class="src-id">users_like&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'pizza'</span><span class="src-sym">,</span><span class="src-str">'fish'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;<span class="src-comm">//&nbsp;save&nbsp;group&nbsp;to&nbsp;database&nbsp;and&nbsp;get&nbsp;ID&nbsp;of&nbsp;newly&nbsp;created&nbsp;group</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$new_group_id&nbsp;</span>=&nbsp;<span class="src-var">$group</span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#methodsave">save</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
</ol></div></p><p><strong>2)</strong> Manage group tags:  <div class="src-code"><ol><li><div class="src-line">&nbsp;<span class="src-comm">//&nbsp;work&nbsp;with&nbsp;user&nbsp;group&nbsp;named&nbsp;'my_user_group'</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$group&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../psa/Psa_Group.html">Psa_Group</a></span><span class="src-sym">(</span><span class="src-str">'my_user_group'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;<span class="src-comm">//&nbsp;add&nbsp;tag&nbsp;'soap_controller',&nbsp;'checkout'&nbsp;and&nbsp;'download'&nbsp;to&nbsp;group</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-comm">//&nbsp;so&nbsp;all&nbsp;users&nbsp;in&nbsp;this&nbsp;group&nbsp;will&nbsp;have&nbsp;those&nbsp;tags</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$group</span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#methodadd_tag">add_tag</a><span class="src-sym">(</span><span class="src-str">'soap_controller'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$group</span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#methodadd_tag">add_tag</a><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'checkout'</span><span class="src-sym">,</span><span class="src-str">'download'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;<span class="src-comm">//&nbsp;remove&nbsp;tag&nbsp;'admin'</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$group</span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#methodremove_tag">remove_tag</a><span class="src-sym">(</span><span class="src-str">'admin'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-comm">//&nbsp;you&nbsp;have&nbsp;to&nbsp;save&nbsp;group&nbsp;to&nbsp;store&nbsp;tags&nbsp;to&nbsp;database</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$group</span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#methodsave">save</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
</ol></div></p><p><strong>Note:</strong> Read more about the tags <a href="../psa/tutorial_psa_features.pkg.html#usersgroups.tags">here</a>.</p></p>
		<p class="notes">
			Located in <a class="field" href="_scripts---Psa_Group.class.php.html">/scripts/Psa_Group.class.php</a> (line <span class="field"><a href="../__filesource/fsource_psa__scriptsPsa_Group.class.php.html#a70">70</a></span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>



	<a name="sec-var-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Variable Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
							| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
								</div>
		<div class="info-box-body">
			<div class="var-summary">
																																																<div class="var-title">
					<img src="../media/images/Variable.png" alt=" " />
					<span class="var-type">int</span>
					<a href="#$exists" title="details" class="var-name">$exists</a>
				</div>
																<div class="var-title">
					<img src="../media/images/Variable.png" alt=" " />
					<span class="var-type">int</span>
					<a href="#$id" title="details" class="var-name">$id</a>
				</div>
																<div class="var-title">
					<img src="../media/images/Variable.png" alt=" " />
					<span class="var-type">string</span>
					<a href="#$name" title="details" class="var-name">$name</a>
				</div>
																<div class="var-title">
					<img src="../media/images/Variable.png" alt=" " />
					<span class="var-type">array</span>
					<a href="#$tags" title="details" class="var-name">$tags</a>
				</div>
											</div>
		</div>
	</div>

	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																		<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
				 
				|
						<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																																																<div class="method-definition">
					<img src="../media/images/Constructor.png" alt=" "/>
											<span class="method-result">Psa_Group</span>
										<a href="#__construct" title="details" class="method-name">__construct</a>
											(<span class="var-type">int|string</span>&nbsp;<span class="var-name">$group</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">int</span>
										<a href="#add_tag" title="details" class="method-name">add_tag</a>
											(<span class="var-type">string|array</span>&nbsp;<span class="var-name">$tag</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">int</span>
										<a href="#add_user" title="details" class="method-name">add_user</a>
											(<span class="var-type">int|array</span>&nbsp;<span class="var-name">$user_id</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">int</span>
										<a href="#remove_tag" title="details" class="method-name">remove_tag</a>
											(<span class="var-type">string|array</span>&nbsp;<span class="var-name">$tag</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">int</span>
										<a href="#remove_user" title="details" class="method-name">remove_user</a>
											(<span class="var-type">int|array</span>&nbsp;<span class="var-name">$user_id</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">int</span>
										<a href="#save" title="details" class="method-name">save</a>
										()
									</div>
											</div>
		</div>
	</div>		

	<a name="sec-vars"></a>
	<div class="info-box">
		<div class="info-box-title">Variables</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
						
			
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			
<a name="var$exists" id="$exists"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<img src="../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">int</span>
			<span class="var-name">$exists</span>
			 = <span class="var-default"> 0</span>			(line <span class="line-number"><a href="../__filesource/fsource_psa__scriptsPsa_Group.class.php.html#a146">146</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Flag if the group exists in the database.</p>
<p class="description"><p>This value is set after group object is instanced or after saving a newly created group.  You can use it to check if the group exists in the database.</p><p><strong>Note:</strong> You have read access to this property.</p></p>
	<ul class="tags">
				<li><span class="field">var:</span> 1-true, 0-false</li>
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	
		
		

</div>
<a name="var$id" id="$id"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<img src="../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">int</span>
			<span class="var-name">$id</span>
						(line <span class="line-number"><a href="../__filesource/fsource_psa__scriptsPsa_Group.class.php.html#a80">80</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Group ID.</p>
<p class="description"><p>Primary key from <em>psa_group</em> database table.</p><p><strong>Note:</strong> You have read access to this property.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	
		
		

</div>
<a name="var$name" id="$name"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<img src="../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$name</span>
						(line <span class="line-number"><a href="../__filesource/fsource_psa__scriptsPsa_Group.class.php.html#a90">90</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Name of the group.</p>
<p class="description"><p>There cannot be two groups with the same name.  You will need to set this property when creating a new group or renaming group.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	
		
		

</div>
<a name="var$tags" id="$tags"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<img src="../media/images/Variable.png" />
		<span class="var-title">
			<span class="var-type">array</span>
			<span class="var-name">$tags</span>
			 = <span class="var-default">array()</span>			(line <span class="line-number"><a href="../__filesource/fsource_psa__scriptsPsa_Group.class.php.html#a115">115</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Array with group tags.</p>
<p class="description"><p>Indexes of this array are tag names. This array contains only tags that are assigned to this group.  Manage this array with <a href="../psa/Psa_Group.html#methodadd_tag">add_tag()</a> and <a href="../psa/Psa_Group.html#methodremove_tag">remove_tag()</a> methods.  Read more about tags <a href="../psa/tutorial_psa_features.pkg.html#usersgroups.tags">here</a>.</p><p>Example:<pre> Array
 (
     ['soap_controller'] => 1  // index is tag id (name). All elements have value 1.
     ['download_image'] => 1
     ['admin_operations'] => 1
 )</pre></p><p><strong>Note:</strong> You have read access to this property.</p></p>
	<ul class="tags">
				<li><span class="field">see:</span> <a href="../psa/Psa_Group.html#methodadd_tag">Psa_Group::add_tag()</a></li>
				<li><span class="field">see:</span> <a href="../psa/Psa_Group.html#methodremove_tag">Psa_Group::remove_tag()</a></li>
				<li><span class="field">access:</span> protected</li>
			</ul>
	
	
		
		

</div>
						
		</div>
	</div>
	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
														<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Constructor.png" />
		<span class="method-title">Constructor __construct</span> (line <span class="line-number"><a href="../__filesource/fsource_psa__scriptsPsa_Group.class.php.html#a180">180</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Constructor.</p>
<p class="description"><p>Must be called with group id (integer value) or group name (string value) as argument.  Pass <kbd>'new'</kbd> (string) argument if you want to create a new group.  If you want to call constructor with group id (integer value) be sure to pass integer  as argument and use cast operator <kbd>(int)</kbd>.  See examples in <a href="../psa/Psa_Group.html">Psa_Group</a> class description.</p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">Psa_Group</span>
		<span class="method-name">
			__construct
		</span>
					(<span class="var-type">int|string</span>&nbsp;<span class="var-name">$group</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int|string</span>
				<span class="var-name">$group</span><span class="var-description">: group id or 'new' if new group should be created</span>			</li>
				</ul>
		
			
	</div>
<a name="methodadd_tag" id="add_tag"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">add_tag</span> (line <span class="line-number"><a href="../__filesource/fsource_psa__scriptsPsa_Group.class.php.html#a440">440</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Adds group tags.</p>
<p class="description"><p>It manage <a href="../psa/Psa_Group.html#var$tags">$tags</a> member array.  You need to call <a href="../psa/Psa_Group.html#methodsave">save()</a> method after to store tags to database.  On error <a href="../psa/exceptions/Psa_Group_Exception.html">Psa_Group_Exception</a> will be thrown.  See examples and note in <a href="../psa/Psa_Group.html">Psa_Group</a> class description.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> 0 for failure, 1 for success</li>
				<li><span class="field">see:</span> <a href="../psa/Psa_Group.html#methodremove_tag">Psa_Group::remove_tag()</a></li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">int</span>
		<span class="method-name">
			add_tag
		</span>
					(<span class="var-type">string|array</span>&nbsp;<span class="var-name">$tag</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string|array</span>
				<span class="var-name">$tag</span><span class="var-description">: name of the tag or array with tag names.</span>			</li>
				</ul>
		
			
	</div>
<a name="methodadd_user" id="add_user"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">add_user</span> (line <span class="line-number"><a href="../__filesource/fsource_psa__scriptsPsa_Group.class.php.html#a568">568</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Puts user in the group or more users if the <var>$user_id</var> argument is array.</p>
<p class="description"><p>Group membership changes are immediately stored in the database and you don't have to  call <a href="../psa/Psa_Group.html#methodsave">save()</a> method after.  If you creating a new group this method must be called after <a href="../psa/Psa_Group.html#methodsave">save()</a> method.  Throws <a href="../psa/exceptions/Psa_Group_Exception.html">Psa_Group_Exception</a> on error.</p><p>Example:  <div class="src-code"><ol><li><div class="src-line">&nbsp;<span class="src-comm">//&nbsp;group&nbsp;object</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$group&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../psa/Psa_Group.html">Psa_Group</a></span><span class="src-sym">(</span><span class="src-str">'my_user_group'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-comm">//&nbsp;put&nbsp;users&nbsp;with&nbsp;IDs&nbsp;1,3&nbsp;and&nbsp;6&nbsp;into&nbsp;the&nbsp;group</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$group</span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#methodadd_user">add_user</a><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,</span><span class="src-num">3</span><span class="src-sym">,</span><span class="src-num">6</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
</ol></div></p><p></p></p>
	<ul class="tags">
				<li><span class="field">return:</span> 1 for success, -1 user already was in the group (or more groups)  or user does not exists</li>
				<li><span class="field">see:</span> <a href="../psa/Psa_Group.html#methodremove_user">Psa_Group::remove_user()</a></li>
				<li><span class="field">throws:</span> Psa_Group_Exception</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">int</span>
		<span class="method-name">
			add_user
		</span>
					(<span class="var-type">int|array</span>&nbsp;<span class="var-name">$user_id</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int|array</span>
				<span class="var-name">$user_id</span><span class="var-description">: id of the user. Or array with user ids.</span>			</li>
				</ul>
		
			
	</div>
<a name="methodremove_tag" id="remove_tag"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">remove_tag</span> (line <span class="line-number"><a href="../__filesource/fsource_psa__scriptsPsa_Group.class.php.html#a459">459</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Removes group tags.</p>
<p class="description"><p>It manage <a href="../psa/Psa_Group.html#var$tags">$tags</a> member array.  You need to call <a href="../psa/Psa_Group.html#methodsave">save()</a> method after to store tags to database.  On error <a href="../psa/exceptions/Psa_Group_Exception.html">Psa_Group_Exception</a> will be thrown.  See examples and note in <a href="../psa/Psa_Group.html">Psa_Group</a> class description.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> 0 for failure, 1 for success</li>
				<li><span class="field">see:</span> <a href="../psa/Psa_Group.html#methodadd_tag">Psa_Group::add_tag()</a></li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">int</span>
		<span class="method-name">
			remove_tag
		</span>
					(<span class="var-type">string|array</span>&nbsp;<span class="var-name">$tag</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string|array</span>
				<span class="var-name">$tag</span><span class="var-description">: name of the tag or array with tag names. <kbd>'all'</kbd> to remove all tags.</span>			</li>
				</ul>
		
			
	</div>
<a name="methodremove_user" id="remove_user"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">remove_user</span> (line <span class="line-number"><a href="../__filesource/fsource_psa__scriptsPsa_Group.class.php.html#a596">596</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Removes user from the group or more users if the <var>$user_id</var> argument is array.</p>
<p class="description"><p>Group membership changes are immediately stored in the database and you don't have to  call <a href="../psa/Psa_Group.html#methodsave">save()</a> method after.  If you creating a new group this method must be called after <a href="../psa/Psa_Group.html#methodsave">save()</a> method.  Throws <a href="../psa/exceptions/Psa_Group_Exception.html">Psa_Group_Exception</a> on error.</p><p>Example:  <div class="src-code"><ol><li><div class="src-line">&nbsp;<span class="src-comm">//&nbsp;group&nbsp;object</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$group&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../psa/Psa_Group.html">Psa_Group</a></span><span class="src-sym">(</span><span class="src-str">'my_user_group'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-comm">//&nbsp;remove&nbsp;user&nbsp;with&nbsp;ID&nbsp;6&nbsp;from&nbsp;the&nbsp;group</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$group</span><span class="src-sym">-&gt;</span><a href="../psa/Psa_Group.html#methodremove_user">remove_user</a><span class="src-sym">(</span><span class="src-num">6</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
</ol></div></p><p></p></p>
	<ul class="tags">
				<li><span class="field">return:</span> 1 for success, -1 user already was in the group (or more groups)  or user does not exists</li>
				<li><span class="field">see:</span> <a href="../psa/Psa_Group.html#methodremove_user">Psa_Group::remove_user()</a></li>
				<li><span class="field">throws:</span> Psa_Group_Exception</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">int</span>
		<span class="method-name">
			remove_user
		</span>
					(<span class="var-type">int|array</span>&nbsp;<span class="var-name">$user_id</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int|array</span>
				<span class="var-name">$user_id</span><span class="var-description">: id of the user. Or array with user ids.</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsave" id="save"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">save</span> (line <span class="line-number"><a href="../__filesource/fsource_psa__scriptsPsa_Group.class.php.html#a318">318</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Saves all properties of the group object to the database.</p>
<p class="description"><p>All saved properties will be restored   when group object is created.  It also sets <a href="../psa/Psa_Group.html#var$id">$id</a> member variable if a new group is created.  See examples in <a href="../psa/Psa_Group.html">Psa_Group</a> class description. This method will throw  <a href="../psa/exceptions/Psa_Group_Exception.html">Psa_Group_Exception</a> on error.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> id of saved group for success</li>
				<li><span class="field">see:</span> <a href="../psa/Psa_Group.html#method__construct">Psa_Group::__construct()</a></li>
				<li><span class="field">throws:</span> Psa_Group_Exception</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">int</span>
		<span class="method-name">
			save
		</span>
				()
			</div>
	
		
			
	</div>
						
		</div>
	</div>

	
	<p class="notes" id="credit">
		Documentation generated on Thu, 21 Oct 2010 01:40:51 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.3</a>
	</p>
	</div></body>
</html>